﻿using System;
using System.Collections.ObjectModel;
using System.Linq;
using SoftSource.Common;
using SoftSource.Timecard.Web.Data;

namespace SoftSource.Timecard.ReportDataClasses
{
    public sealed class UserStartEndDateReportTemplateData
    {
        public UserStartEndDateReportTemplateData()
        {
            this.Users = new ObservableCollection<UserSummary>();
            this.Users.Populate(App.Model.UserSummaries.Entities
                .Where(u => u.IsActive)
                .OrderBy(u => u.FullName));
            this.UserID = WebContext.Current.User.UserID;
            this.EndDate = DateTime.Now;
            this.StartDate = this.EndDate.AddMonths(-1);
        }

        public ObservableCollection<UserSummary> Users { get; set; }

        [Parameter]
        public int UserID { get; set; }

        [Parameter]
        public DateTime StartDate { get; set; }

        [Parameter]
        public DateTime EndDate { get; set; }
    }
}
